home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK2.toast / Development Kits (Disc 2) / QuickDraw GX / Programming Stuff / Sample Code / Printing Samples / Printer Drivers… / LaserWriterIIsc (New GX v1.1) / ChooserSupport.r < prev    next >
Encoding:
Text File  |  1995-04-10  |  6.9 KB  |  267 lines  |  [TEXT/MPS ]

  1. /* ------------------------------------------------------------------------------
  2. FILENAME
  3.     ChooserSupport.r
  4.  
  5. DESCRIPTION
  6.     This module contains the LaserWriter SC constants, types, and resources that
  7.     are needed in order for the driver to work with the Chooser.
  8.             
  9.     Note: all resources should be designated to load into the system heap.
  10.  
  11. COPYRIGHT
  12.      Copyright Apple Computer, Inc. 1992
  13.      All rights reserved. 
  14.     
  15. -------------------------------------------------------------------------------- */
  16.  
  17. // System 7.0 Compatible
  18. #define SystemSevenOrLater        1
  19.  
  20. // Include System Resource Definitions
  21. #include "Types.r"
  22. #include "SysTypes.r"
  23.  
  24. // Include the LaserWriter SC driver constants that are used in the resources 
  25. #include "LaserSCResources.h"
  26.  
  27. // Include the public QuickDraw GX printing files 
  28. #include "PrintingResTypes.r"
  29.  
  30. // Include the LaserWriterSC Driver's LDEF and PACK Code Segments ===== */
  31.  
  32. include "LWSC_PACK";
  33. include "LWSC_LDEF";
  34.  
  35.  
  36. /*********************************************************************************************
  37.      THINGS TO CONTROL THE DEFAULT CHOOSING MECHANSIM
  38. *********************************************************************************************/
  39.  
  40. // The 'look' resource is used by the driver's PACK to know how to communicate 
  41. // to the device.  This resource contains the default settings, as the actual value 
  42. // can be found in the desktop printer. 
  43.  
  44. resource 'look' (kLookRsrcID, sysheap) 
  45. {
  46.     1,                                    // use the first in our list by default
  47.     {
  48.         "SCSI",            kSCSICommRsrcID,                iconCells,                                "";
  49.         "Servers",        kPrinterShareCommRsrcID,    isAppleTalk+isPrinterShare,        "LaserWriterSCIS";
  50.     };
  51. };
  52.  
  53.  
  54. // This 'comm' resource defines the default communication settings when using this 
  55. // driver with PrinterShare. 
  56.  
  57. resource 'comm' (kPrinterShareCommRsrcID)
  58. {
  59.     PrinterShare
  60.     {
  61.         "",
  62.         0
  63.     };
  64. };
  65.  
  66.  
  67. // This 'comm' resource defines the default communication settings when using this 
  68. // driver with direct SCSI communications. 
  69.  
  70. resource 'comm' (kSCSICommRsrcID)
  71. {
  72.     SCSI
  73.     {
  74.         0,                                        // release device routine 
  75.         0,                                        // io attibutes 
  76.         0,                                        // status byte 
  77.         0,                                        // scsi bus number 
  78.         0,                                        // scsi ID 
  79.         0,                                        // chunk level 
  80.         0,                                        // acquire routine (use default)  
  81.         2,                                        // deviceType to look for 
  82.         27,                                    // minimum length of additional response data 
  83.         8,                                        // bytes from start for search 
  84.         "APPLE   PERSONAL LASER  ",    // search string 
  85.     };
  86. };
  87.     
  88.  
  89. /*********************************************************************************************
  90.     STANDARD CHOOSER PACK STUFF
  91. *********************************************************************************************/
  92.  
  93. // NBP Lookup type (maxed out so resource file won't need updating)
  94. resource 'STR ' (-4096)
  95. {
  96.     "XXXXXXXXXXXXXXXXXXXXXX";
  97. };
  98.  
  99. // NBP timeout value
  100. type 'GNRL'
  101. {
  102.     byte;    // timeout
  103.     byte;    // retries
  104. };
  105.  
  106. resource 'GNRL' (-4096)
  107. {
  108.     11,
  109.     5
  110. };
  111.  
  112. // title string (we'll put a control here, so we don't want a title)
  113. resource 'STR ' (-4091)
  114. {
  115.     "";
  116. };
  117.  
  118. // "left" button title
  119. resource 'STR ' (-4093)
  120. {
  121.     "Create";
  122. };
  123.  
  124. // rectangle list
  125. resource 'nrct' (-4096) {
  126.     {
  127.     {112, 251, 132, 311};            // left button
  128.     {0,0,0,0};                            // right button
  129.     {-101, 180, -101+20, 400};        // on button (location of device list - popup is placed here)
  130.     {0,0,0,0};                            // off button
  131.     {0,0,0,0};                            // button label
  132.     };
  133. };
  134.  
  135. // Menu used to select between direct connect, AppleTalk, and Servers
  136. resource 'MENU' (-4096)
  137. {
  138.     -4096,
  139.     textMenuProc,
  140.     0xFFFFFFFF,    
  141.     enabled,
  142.     "",
  143.     {
  144.     }
  145. };
  146.  
  147. // Pop-up control used to select between direct connect printers and those being shared on the network
  148. resource 'CNTL' (-4096, purgeable)
  149. {
  150.     {0, 0, 20, 213},                            // zero based control location
  151.     0,                                                // Title options 0 = Left justified
  152.     visible,                                        // Should we display the control?
  153.     95,                                            // Title Width
  154.     -4096,                                        // 'MENU' to display
  155.     popupMenuCDEFproc+popupFixedWidth,    // CDEF = CDEFID * 16 + varCode
  156.     0,                                             // refCon = ResType to append = None
  157.     "Connect via:"                                // Control title
  158. };
  159.  
  160. resource 'DITL' (-4096) 
  161. {
  162.     {
  163.         {3, 238, 23, 238 + 213}, 
  164.             Control {enabled, -4096},
  165.     };
  166. };
  167.  
  168.  
  169. resource 'DITL' (-4095) {
  170.     {    /* array DITLarray: 2 elements */
  171.         /* [1] */
  172.         {143, 310, 163, 368},
  173.         Button {
  174.             enabled,
  175.             "OK"
  176.         },
  177.         /* [2] */
  178.         {23, 87, 119, 377},
  179.         StaticText {
  180.             disabled,
  181.             "This printer driver could not be used.\n\n"
  182.             "Quitting one or more applications and then "
  183.             "trying again may allow you to use this "
  184.             "printer driver."
  185.         }
  186.     }
  187. };
  188.  
  189. resource 'ALRT' (-4095) {
  190.     {30, 30, 30+175, 30+380},
  191.     -4095,
  192.     {    /* array: 4 elements */
  193.         /* [1] */
  194.         OK, visible, sound1,
  195.         /* [2] */
  196.         OK, visible, sound1,
  197.         /* [3] */
  198.         OK, visible, sound1,
  199.         /* [4] */
  200.         OK, visible, sound1
  201.     },
  202.     alertPositionParentWindowScreen
  203. };
  204.  
  205. //-----------------------------------------------------------------------------------
  206. // CHOOSER PACK HELP RESOURCES
  207. //-----------------------------------------------------------------------------------
  208.  
  209.  
  210. /*    Any Chooser package can get balloons on all items that are normally 
  211.     added to the Chooser dialog by containing a STR# resource of 
  212.     resource ID = PackResID (-5694) and following the convention below:
  213.         
  214.         resource 'STR#' (-5694, purgeable) {
  215.           {        "kEnabledLeftButton";    // message for button (or control) that is Enabled but not checked
  216.                 "kDisabledLeftButton";    // message for the control that is Disabled
  217.                 "kCheckedLeftButton";    // message for the control that is Checked (ie CtrlValue>0)
  218.                 "kOtherLeftButton";        // message for the control that is Other (ie CtrlValue>1)
  219.                 "kEnabledRightButton";
  220.                 "kDisabledRightButton";
  221.                 "kCheckedRightButton";
  222.                 "kOtherRightButton";
  223.                 "kEnabledOnButton";
  224.                 "kDisabledOnButton";
  225.                 "kCheckedOnButton";
  226.                 "kOtherOnButton";
  227.                 "kEnabledOffButton";
  228.                 "kDisabledOffButton";
  229.                 "kCheckedOffButton";
  230.                 "kOtherOffButton";
  231.                 "kEnabledOnOffTitle";
  232.                 "kDisabledOnOffTitle";
  233.                 "kCheckedOnOffTitle";
  234.                 "kOtherOnOffTitle";
  235.           }
  236.         };
  237.         
  238.     This is a horrible Chooser hack for 7.0 - but we'll follow along in GX.
  239. */
  240.  
  241. resource 'STR#' (-5694, purgeable) {
  242.   {        
  243.   
  244.           "Click here to create a desktop printer for the selected device."; // message for button (or control) that is Enabled but not checked
  245.         "You have not selected a device to create, or there is not enough memory to create a desktop printer at this time.";    // message for the control that is Disabled
  246.         "";    // message for the control that is Checked (ie CtrlValue>0)
  247.         "";    // message for the control that is Other (ie CtrlValue>1)
  248.         "";    // kEnabledRightButton
  249.         "";    // kDisabledRightButton
  250.         "";    // kCheckedRightButton
  251.         "";    // kOtherRightButton
  252.         "Use this pop–up menu to select the type of connection for the desktop printer you are creating.";
  253.         "";    // kDisabledOnButton
  254.         "";    // kCheckedOnButton 
  255.         "";    // kOtherOnButton
  256.         "";    // kEnabledOffButton
  257.         "";    // kDisabledOffButton
  258.         "";    // kCheckedOffButton
  259.         "";    // kOtherOffButton
  260.         "";    // kEnabledOnOffTitle
  261.         "";    // kDisabledOnOffTitle
  262.         "";    // kCheckedOnOffTitle
  263.         "";    // kOtherOnOffTitle
  264.   }
  265. };
  266.  
  267.